package kr.inani.android.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.HorizontalScrollView;

public class CustomHorizontalScrollView extends HorizontalScrollView
{
	private int scrollX;
	public CustomHorizontalScrollView(Context context, AttributeSet attrs, int defStyle)
	{
		super(context, attrs, defStyle);
	}

	public CustomHorizontalScrollView(Context context, AttributeSet attrs)
	{
		super(context, attrs);
		init();

	}

	public CustomHorizontalScrollView(Context context)
	{
		super(context);
	}
	
	public int getScrolledX()
	{
		return scrollX;
	}
	
	
	private void init()
	{
		setOnTouchListener(new OnTouchListener()
		{

			@Override
			public boolean onTouch(View v, MotionEvent event)
			{
				scrollX = getScrollX();
				return false;

			}

		});
	}

}
